home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / GameKit / gamekit-1 / GrayView2.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  52 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import <gamekit/GrayView2.h>
  5. #import <dpsclient/psops.h>    // PSxxx functions
  6. #import <dpsclient/wraps.h>    // PSxxx functions
  7.  
  8. @implementation GrayView2
  9.  
  10. - aroundFrame:(const NXRect *)aRect :(float)y;
  11. {
  12.     NXRect rects[4];
  13.     
  14.     [self lockFocus];
  15.     PSsetgray(NX_LTGRAY);
  16.     rects[0].size.width = aRect->origin.x ;//- 1;
  17.     rects[1].size.width = bounds.size.width - aRect->origin.x - aRect->size.width ;//- 1;
  18.     rects[2].size.width = aRect->size.width;
  19.     rects[3].size.width = aRect->size.width;
  20.     rects[0].size.height = bounds.size.height;
  21.     rects[1].size.height = bounds.size.height;
  22.     rects[2].size.height = bounds.size.height - aRect->origin.y - aRect->size.height - 1 + y;
  23.     rects[3].size.height = aRect->origin.y - y - 1;
  24.     rects[0].origin.x = 0;
  25.     rects[1].origin.x = aRect->size.width + aRect->origin.x ;//+ 1;
  26.     rects[2].origin.x = aRect->origin.x;
  27.     rects[3].origin.x = aRect->origin.x;
  28.     rects[0].origin.y = 0;
  29.     rects[1].origin.y = 0;
  30.     rects[2].origin.y = aRect->origin.y + aRect->size.height - y;
  31.     rects[3].origin.y = 0;
  32.     NXRectFillList(&rects[0], 4);
  33.     [self unlockFocus];
  34.     return self;
  35. }
  36.  
  37. - drawSelf:(NXRect *)rects :(int)rectCount    // redraws the screen.
  38. {        // right now, it's stupid and always redraws the whole view.
  39.  
  40.     if ([self window] == nil)
  41.         return self;    // exit if no window to draw in
  42.     
  43.     [self lockFocus];
  44.     PSsetgray(NX_LTGRAY);
  45.     NXRectFill(&bounds);
  46.     //[[self window] flushWindow];
  47.     [self unlockFocus];
  48.     return self;
  49. }
  50.  
  51. @end
  52.